package cn.com.xxlibrary.dao.impl;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import cn.com.xxlibrary.dao.ISystemDao;
import cn.com.xxlibrary.orm.ManagerInfoBean;
import cn.com.xxlibrary.orm.SystemLogBean;
import cn.com.xxlibrary.util.UtilTools;

@Transactional
@Repository("systemDao")
public class SystemDaoImpl implements ISystemDao {

	@Autowired
	@Qualifier("sessionFactory")
	private SessionFactory sessionFactory;

	@Override
	public void recordLog(SystemLogBean logBean, ManagerInfoBean operateManager) {
		Session session = sessionFactory.getCurrentSession();
		session.save(logBean);
	}

	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}

	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

}
